package com.partvoyage.client.mvp2.view.information;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.InlineHTML;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.Layout;

public class TagCloudView extends HLayout implements TagCloudPresenter.Display {

	TagCloudComponent tagCloudComponent=null;

	public TagCloudView() {
		super();
		setWidth100();
		// information point
		setBorder("5px");
		setHeight100();
		tagCloudComponent = new TagCloudComponent();
		addMember(tagCloudComponent);
	}

	private class TagCloudComponent extends Composite {
		private LayoutPanel cloud;

		private DecoratorPanel dec;

		public TagCloudComponent() {
			cloud = new LayoutPanel();
			// cloud.addStyleName("cloud");
			dec = new DecoratorPanel();
//			dec.setHeight("100%");
//			dec.setWidth("100%");
			cloud.setHeight("100%");
			cloud.setWidth("100%");

			InlineHTML inline = new InlineHTML(" <a href='"
					+ "http://www.google.com" + "'>" + "GOOGLE" + "</a>&nbsp;");
//			cloud.add(inline);
//			inline = new InlineHTML(" <a href='" + "http://www.google.com"
//					+ "'>" + "GOOGLE" + "</a>&nbsp;");
//			cloud.add(inline);

			dec.setWidget(cloud);
			initWidget(dec);

		}

		public LayoutPanel getCloud() {
			return cloud;
		}

		public void setCloud(LayoutPanel cloud) {
			this.cloud = cloud;
		}

		public DecoratorPanel getDec() {
			return dec;
		}

		public void setDec(DecoratorPanel dec) {
			this.dec = dec;
		}

		public void clear() {
			cloud.clear();
		}

		public void addTag(Widget inline) {
			cloud.add(inline);
		}

	}

	public void clear() {
		tagCloudComponent.clear();
	}

	@Override
	public void addTag(Widget inline) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public LayoutPanel getCloud() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DecoratorPanel getDec() {
		// TODO Auto-generated method stub
		return null;
	}

//	public void addTag(Widget inline) {
//		tagCloudComponent.addTag(inline);
//
//	}
//
//	public LayoutPanel getCloud() {
//		return tagCloudComponent.getCloud();
//	}
//
//	 public DecoratorPanel getDec() {
//	 return tagCloudComponent.getDec();
//	 }
//
//	@Override
//	public void addTag(Widget inline) {
//		// TODO Auto-generated method stub
//		
//	}

}
